/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.longview.io.modules.grasstype.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.longview.io.common.service.TreeService;
import com.longview.io.common.utils.StringUtils;
import com.longview.io.modules.grasstype.entity.GrassType;
import com.longview.io.modules.grasstype.dao.GrassTypeDao;

/**
 * 草地类型Service
 * @author zf
 * @version 2018-04-16
 */
@Service
@Transactional(readOnly = true)
public class GrassTypeService extends TreeService<GrassTypeDao, GrassType> {

	public GrassType get(String id) {
		return super.get(id);
	}
	
	public List<GrassType> findList(GrassType grassType) {
		if (StringUtils.isNotBlank(grassType.getParentIds())){
			grassType.setParentIds(","+grassType.getParentIds()+",");
		}
		return super.findList(grassType);
	}
	
	@Transactional(readOnly = false)
	public void save(GrassType grassType) {
		super.save(grassType);
	}
	
	@Transactional(readOnly = false)
	public void delete(GrassType grassType) {
		super.delete(grassType);
	}
	
}